package org.ogv.usada.views;

import org.ogv.OGV;
import org.ogv.usada.models.GP;

import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class Clock extends Sprite {

	public 	float 	progress;
	private Sprite 	pointer;

	public Clock() {
		super(OGV.asset.getTextureRegion(GP.$().RES_TEXR_CLOCK_BG));
		pointer = new Sprite(OGV.asset.getTextureRegion(GP.$().RES_TEXR_CLOCK_POINT));
		pointer.setOrigin(pointer.getWidth()/2, 5);
		progress = 0;
	}
	
	@Override
	public void draw(SpriteBatch spriteBatch) {
		super.draw(spriteBatch);
		
		//draw pointer
		pointer.setPosition(getX() + (getWidth() - pointer.getWidth()) * 0.5f, getY() + getHeight() * 0.5f - 5);
		pointer.setRotation(progress*360);
		pointer.draw(spriteBatch);
	}
}
